package employee;
/**
 * 初始化类
 */
public class Init {
    static Employee[] emps = new Employee[10];
    static Porson[] pors = new Porson[2];

    static {
        Employee zhangsan = new Employee(1,"张三",5000);
        addEmp(zhangsan);
        Employee lisi = new Employee(2,"李四",6000);
        addEmp(lisi);
        Employee wangwu = new Employee(3,"王五",7000);
        addEmp(wangwu);
        Porson lishuang = new Porson("李爽","19980120");
        addPor(lishuang);
        Porson admin = new Porson("admin","123456");
        addPor(admin);
    }
    public static void addEmp(Employee emp){
        for (int i = 0; i <emps.length ; i++) {
            if (emps[i]==null){
                emps[i]=emp;
                break;
            }
        }
    }
    public static void addPor(Porson por){
        for (int i = 0; i <pors.length ; i++) {
            if (pors[i]==null){
                pors[i]=por;
                break;
            }
        }
    }







}
